package cn.hyy.controller;

import cn.hyy.domain.User;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class UserController {
    /**
     * 服务提供者暴露接口，让服务消费者调用
     */
    @GetMapping("/user/{id}")
    public User getById(@PathVariable("id") Long id){
        try {
            Thread.sleep(5000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return new User(id,"yy","yy");
    }
}
